import React from "react";
import axios from "axios";
export default function App() {
  const getFile = ({ target }) => {
    const fd = new FormData();
    fd.append("img", target.files[0]);
    axios({
      url: "http://localhost:8080",
      method: "POST",
      data: fd,
    }).then((result) => {
      const{data}=result
      const image=new Image(200,200)
      image.src=data
      document.body.appendChild(image)
    });
  };
  return (
    <>
      <input type="file" onChange={getFile} />
    </>
  );
}
